/*******************************************************************************
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
//检查开始时间		
		function checkBeginTime(beginTime){
	 			var beginTimes=beginTime.substring(0,10).split('-');
				var beginTime=beginTime=beginTimes[1]+'-'+beginTimes[2]+'-'+beginTimes[0]+'|'+beginTime.substring(10,19);
	 			
				$.ajax({
					type:"POST",
					url:"auctionTimeOrders.do?cmd=ajaxCheckBeginTime&beginTime="+beginTime,
					processData:false,
					success:function(msg){
						if(msg==1){

								alert('开始时间必须大于系统时间');
								return false;
							}
						if(msg==2){
								alert('时段已被占用');
								return false;
							}				
					}
			
				});	
		 	}
		
		//一次性限制
		function onceCheck(){
 			var beginTime=$('#beginTime').val();
			if(beginTime==""){
					alert('开始时间不能为空');
					return false;
				}
			var endTime=$('#endTime').val();
			if(endTime==""){
					alert('结束时间不能为空');
					return false;
				}

			var result=comptime(beginTime,endTime);
			if(result=="exception"){
					alert('系统错误');
					return false;
				}
			if(result==-1){
					alert('结束时间必须大于开始时间');
					return false;
				}
			checkBeginTime(beginTime);
	 	}
		function dayCheck(){
			
			
		}
		
		//只检查时间大小
 		function compareJustTime(beginTime.endTime){
				var begin=beginTime.substring(0,1);
				var end=endTime.substring(0,1);
				if(begin>end){
					return false;
					}else{
						return true;
						}
	 		}